shouldNotBeNull

Verify that the value is not null.

void
shouldNotBeNull
(
T
)
(
in auto ref T value
,
in string file = __FILE__
,
in size_t line = __LINE__
)

Throws

UnitTestException on failure

Examples

1 class Foo {
2     this(int i) {
3         this.i = i;
4     }
5 
6     override string toString() const {
7         import std.conv : to;
8 
9         return i.to!string;
10     }
11 
12     int i;
13 }
14 
15 shouldNotBeNull(new Foo(4));

Meta